
class HomeModel {
final ConfigModel? config;
final List<CommonModel>? bannerList;
final List<CommonModel>? localNavList;
final List<CommonModel>? subNavList;
final GridNavModel? gridNav;
final SalesBoxModel? salesBox;

  HomeModel({this.config,this.bannerList,this.localNavList,this.subNavList,this.gridNav,this.salesBox});
  factory HomeModel.fromJson(Map<String, dynamic> json){
    var bannerListListJson = json['bannerList'] as List;
    List<CommonModel>? bannserList = bannerListListJson.map((e) => CommonModel.fromJson(e)).toList();

    var localNavListJson = json['localNavList'] as List;
    List<CommonModel>? localNavList = localNavListJson.map((e) => CommonModel.fromJson(e)).toList();

    var subNavListJson = json['subNavList'] as List;
    List<CommonModel>? subNavList = subNavListJson.map((e) => CommonModel.fromJson(e)).toList();
    return HomeModel(
       config: ConfigModel.fromJson(json['config']),
        bannerList: bannserList,
        localNavList: localNavList,
        subNavList: subNavList,
        gridNav:GridNavModel.fromJson(json['gridNav']),
        salesBox:SalesBoxModel.fromJson(json['salesBox']),
    );


  }

}



class ConfigModel{
  final String? searchUrl;
  ConfigModel({this.searchUrl});
  factory ConfigModel.fromJson(Map<String, dynamic> json){
    return ConfigModel(
      searchUrl: json["searchUrl"] ?? "",
    );
  }
}

class CommonModel{
  final String? icon;
  final String? title;
  final String? url;
  final String? statusBarColor;
  final bool? hideAppBar;

  CommonModel({this.icon, this.title, this.url, this.statusBarColor, this.hideAppBar});
  factory CommonModel.fromJson(Map<String, dynamic> json){
    return CommonModel(
      icon: json["icon"] ?? "",
      title: json["title"] ?? "",
      url: json["url"] ?? "",
      statusBarColor: json["statusBarColor"] ?? "",
      hideAppBar: json["hideAppBar"] ?? false,
    );
  }
}

class GridNavModel{
  final GridNavItemModel? hotel;
  final GridNavItemModel? flight;
  final GridNavItemModel? travel;


  GridNavModel({this.hotel, this.flight, this.travel});
  factory GridNavModel.fromJson(Map<String, dynamic> json){
    return GridNavModel(
      hotel: GridNavItemModel.fromJson(json['hotel'] ?? {}),
      flight: GridNavItemModel.fromJson(json['flight'] ?? {}),
      travel: GridNavItemModel.fromJson(json['travel'] ?? {}),
    );
  }
}

class GridNavItemModel{
  final String? startColor;
  final String? endColor;
  final CommonModel? mainItem;
  final CommonModel? item1;
  final CommonModel? item2;
  final CommonModel? item3;
  final CommonModel? item4;

  GridNavItemModel({this.startColor, this.endColor, this.mainItem, this.item1, this.item2, this.item3, this.item4});
  factory GridNavItemModel.fromJson(Map<String, dynamic> json){
    return GridNavItemModel(
      startColor: json["startColor"] ?? "",
      endColor: json["endColor"] ?? "",
      mainItem: CommonModel.fromJson(json['mainItem'] ?? {}),
      item1: CommonModel.fromJson(json['item1'] ?? {}),
      item2: CommonModel.fromJson(json['item2'] ?? {}),
      item3: CommonModel.fromJson(json['item3'] ?? {}),
      item4: CommonModel.fromJson(json['item4'] ?? {}),
    );
  }
}



class SalesBoxModel{
  final String? icon;
  final String? moreUrl;
  final CommonModel? bigCard1;
  final CommonModel? bigCard2;
  final CommonModel? smallCard1;
  final CommonModel? smallCard2;
  final CommonModel? smallCard3;
  final CommonModel? smallCard4;

  SalesBoxModel({this.icon,this.moreUrl, this.bigCard1, this.bigCard2, this.smallCard1, this.smallCard2, this.smallCard3, this.smallCard4});
  factory SalesBoxModel.fromJson(Map<String, dynamic> json){
    return SalesBoxModel(
      icon: json["icon"] ?? "",
      moreUrl: json["moreUrl"] ?? "",
      bigCard1: CommonModel.fromJson(json['bigCard1'] ?? {}),
      bigCard2: CommonModel.fromJson(json['bigCard2'] ?? {}),
      smallCard1: CommonModel.fromJson(json['smallCard1'] ?? {}),
      smallCard2: CommonModel.fromJson(json['smallCard2'] ?? {}),
      smallCard3: CommonModel.fromJson(json['smallCard3'] ?? {}),
      smallCard4: CommonModel.fromJson(json['smallCard4'] ?? {}),
    );
  }
}